function Channel(graph, meta){
	this.deep = graph.memDeep;
	this.howOld = function(num){
		if (num < this.cursor) return this.cursor-num-1;
		else return this.cursor+this.deep-num-1;
	}
	this.transparency = function(num){
		return (this.deep-this.howOld(num)+0.1)/this.deep;
	}
	this.lw = function (num){
		return this.deep-this.howOld(num);
	}
	this.name = meta.channel;
	this.interval = meta.interval;
	this.unit = meta.unit;
	this.graph = graph;
	this.setGraph = function (graph){ this.graph = graph; };
	this.row = null;
	this.plots = [];
	this.history = [[]];
	this.cursor = 0;
	//this.subPlots=['AVG':[],'MIN':[],'MAX':[]];
	this.toHistory = function(){
		if (this.cursor >= this.deep) this.cursor = 0;
		//console.log('cursor:', this.cursor);
		this.history[this.cursor] = this.plots.slice(0);
		this.cursor++;
		//console.log('history: ', this.history);

	}
	this.setDeep = function(deep){
		this.deep = deep;
	};
	this.avg = [];
	this.min = [];
	this.max = [];
	this.active = false;
	this.disp = {'AVG':false, 'MIN':false, 'MAX':false};
	this.setColors = function(){
		var col = color.assign(this.name);
		var gray = color.toGray(col);
		return [col, color.lighten(col), gray, color.lighten(gray)];
	};
	this.addPlots = function (arr){
		//console.log("add plots:", arr);
		if (this.plots.length != 0) this.toHistory();
		this.plots = [];
		for (var i = 0; i < arr.length; i++){
			this.plots[i] = [i*this.interval, arr[i]];
		}
		//console.log ('plots /'+this.name, this.plots);
		//console.log ('hist /'+this.name, this.history);
	};
	this.addSubPlots = function(par, arr){
		var parSm = par.toLowerCase();
		for (var i = 0; i < arr.length; i++){
			//this.avg[i] = [i*this.interval, arr[i]];
			this[parSm][i] = [i*this.interval, arr[i]];
		}
	}
	this.getDeep = function (){
		return 1;
	};
	this.disable = function(){
		this.active = false;
		this.disp.AVG = false;
		this.disp.MIN = false;
		this.disp.MAX = false;
	}
	this.enable = function(){
		this.active = true;
	}
	this.colors= this.setColors();
}